import React, { useState, useEffect } from 'react'
import { NavBar, SearchBar, Toast, List, Image } from 'antd-mobile'
import { useLocation, useNavigate } from 'react-router-dom'
import { ProductCard, Tag, Button } from 'react-vant';
import Xd from '../../Compution/Xd'
import axios from 'axios'
// import Liebiao from '../../Compution/Liebiao'
function Index() {
    const navigate = useNavigate()
    const [list, setlistt] = useState([])
    const {state}=useLocation()
    const xuanRan = async () => {
        const res = await axios.get('/api/list')
        console.log(res, 'res==')
        const { code, data, message } = res.data
        if (code == 200) {
            Toast.show(message)
            setlistt([...list, ...data])
        }
    }
    useEffect(() => {
        xuanRan()
    }, [])
    return (
        <div>
            <NavBar onBack={() => navigate('/')}>我的消息</NavBar>
            <SearchBar placeholder='请输入内容' />
         <Xd state={state}></Xd>

        </div>
    )
}

export default Index
